Some databases support materialized views. Some databases support user-defined aggregate functions. Few databases, if any, support materialized views with user-defined aggregate functions. Databases that do provide such support have traditionally provided only limited, if any, support for user-defined aggregate functions in materialized views. Built-in aggregate functions (e.g., SUM, COUNT, MIN) have been supported for incremental maintenance in a materialized view. If a materialized view included a user-defined aggregate function then the materialized view had not been able to be incrementally maintained and certain query rewrite options for the materialized view were not available. This may have limited the usefulness of user-defined data types in materialized views since user-defined aggregate functions may be associated with user-defined data types.